package com.zhengshang.api.service.impl;

import java.util.List;
import java.util.Map;

import com.zhengshang.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zhengshang.api.mapper.AppBillProductMapper;
import com.zhengshang.api.domain.AppBillProduct;
import com.zhengshang.api.service.IAppBillProductService;

/**
 * 话费商品Service业务层处理
 * 
 * @author zhengshang
 * @date 2021-06-07
 */
@Service
public class AppBillProductServiceImpl implements IAppBillProductService 
{
    @Autowired
    private AppBillProductMapper appBillProductMapper;

    /**
     * 查询话费商品
     * 
     * @param billId 话费商品ID
     * @return 话费商品
     */
    @Override
    public AppBillProduct selectAppBillProductById(Long billId)
    {
        return appBillProductMapper.selectAppBillProductById(billId);
    }

    @Override
    public AppBillProduct selectWeiKeYunProduct(String specId, Long thirdColumnId) {
        return appBillProductMapper.selectWeiKeYunProduct(specId,thirdColumnId);
    }

    /**
     * 查询话费商品列表
     * 
     * @param appBillProduct 话费商品
     * @return 话费商品
     */
    @Override
    public List<AppBillProduct> selectAppBillProductList(AppBillProduct appBillProduct)
    {
        return appBillProductMapper.selectAppBillProductList(appBillProduct);
    }

    /**
     * 查询话费商品列表
     *
     * @param map 话费商品
     * @return 话费商品
     */
    @Override
    public List<Map> selectAppBillProductList1(Map map) {
        return appBillProductMapper.selectAppBillProductList1(map);
    }

    @Override
    public List<AppBillProduct> selectAppBillProductList2(Map map) {
        return appBillProductMapper.selectAppBillProductList2(map);
    }

    /**
     * 新增话费商品
     * 
     * @param appBillProduct 话费商品
     * @return 结果
     */
    @Override
    public int insertAppBillProduct(AppBillProduct appBillProduct)
    {
        appBillProduct.setCreateTime(DateUtils.getNowDate());
        return appBillProductMapper.insertAppBillProduct(appBillProduct);
    }

    /**
     * 修改话费商品
     * 
     * @param appBillProduct 话费商品
     * @return 结果
     */
    @Override
    public int updateAppBillProduct(AppBillProduct appBillProduct)
    {
        appBillProduct.setUpdateTime(DateUtils.getNowDate());
        return appBillProductMapper.updateAppBillProduct(appBillProduct);
    }

    /**
     * 批量删除话费商品
     * 
     * @param billIds 需要删除的话费商品ID
     * @return 结果
     */
    @Override
    public int deleteAppBillProductByIds(Long[] billIds)
    {
        return appBillProductMapper.deleteAppBillProductByIds(billIds);
    }

    /**
     * 删除话费商品信息
     * 
     * @param billId 话费商品ID
     * @return 结果
     */
    @Override
    public int deleteAppBillProductById(Long billId)
    {
        return appBillProductMapper.deleteAppBillProductById(billId);
    }


}
